Skip to content

Add support of specifying multiple inventory files#1645

Merged
wangxin merged 1 commit intosonic-net:masterfrom
wangxin:multi-inv-pr
May 7, 2020
Merged

Add support of specifying multiple inventory files#1645
wangxin merged 1 commit intosonic-net:masterfrom
wangxin:multi-inv-pr

Conversation

@wangxin
Copy link
Copy Markdown
Collaborator

@wangxin wangxin commented May 6, 2020

Description of PR

Summary:
Fixes # (issue)

The pytest-ansible plugin always assumes that the value
of cli argument '--inventory' is a single inventory file.
With this enhancement, we can pass in multiple inventory
files using the cli argument '--inventory'. The multiple
inventory files can be separated by comma ','.

For example:
pytest --inventory "inventory1, inventory2"
pytest --inventory inventory1,inventory2

This PR is an alternative approach to fix the issue addressed by PR #1594

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • Test case(new/improvement)

Approach

How did you do it?

Added an auto used fixture to enhance the capability of interpreting the value of pytest cli argument '--inventory'.

How did you verify/test it?

Run test scripts that depends on multiple inventory files by specifying multiple inventory files from command line:

py.test --inventory "../ansible/veos, ../ansible/inventory" --host-pattern all --testbed example_testbed_t0 --testbed_file ../ansible/testbed.csv --show-capture no --log-cli-level debug test_nbr_health.py

Any platform specific information?

NA

Supported testbed topology if it's a new test case?

NA

Documentation

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants